import request from '@/utils/request.js'
// import store from '@/store'

// 登录
export function sysLogin(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    noToken: true,
    data
  })
}

// 获取用户基本资料
export function sysProfile() {
  return request({
    url: '/sys/profile',
    method: 'post'
    // headers: {
    //   Authorization: `Bearer ${store.state.user.token}`
    // }
  })
}

// 获取员工基本信息
export function sysUser(id) {
  return request({
    url: `/sys/user/${id}`
  })
}

// 修改员工基本信息
export function sysUserPut(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}

// 获取员工个人基础信息
export function employeesPersonalInfo(id) {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}
// 编辑员工个人基础信息
export function employeesPersonalInfoPut(data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
